
<center><div style="height:35px;"><div id="message">&nbsp;</div></div></center>
<?php if($this->Session->read('message')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('message').'");</script>';
	$this->Session->delete('message');	
	}?>
<?php if($this->Session->read('error')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('error').'",1);</script>';
	$this->Session->delete('error');
}?>

	<form id="listForm" name="listForm" method="get" action="#">
    <table class="list">
      <tbody>
      <tr>
      	<th align="center" width="10px">#</th>
      	<th align="center" width="10px"><input class="checkbox"  type="checkbox" name="all" value="" onclick="checka('listForm');" />
        <th align="left"><?php _resource('config key')?></th>
        <th align="left"><?php _resource('config value')?></th>
        <th align="left"><?php _resource('description')?></th>
		<th align="center"><?php _resource('view order')?></th>
        <th align="left"><?php _resource('created date')?></th>
        <th align="left"><?php _resource('last modified')?></th>        
        <th align="center"><?php _resource('status')?></th>        
        <th align="center" width="100px"><?php _resource('task');?></th>
      </tr>
		<?php
			if(count($data0)>0){
			foreach($data0 as $k=>$v){
		?>
      <tr class="row<?php echo fmod($k,2)+1;?>" onmouseout="this.className='row<?php echo fmod($k,2)+1;?>'" onmouseover="this.className='highlight'">
    	<td align="center"><?php echo $this->Session->read($uses[0].'2.limit')*($this->params['paging'][$uses[0]]['page']-1)+$k+1;?>  
		<td align="center"><input class="checkbox" type="checkbox" id="cb" name="check[<?php echo $v[$uses[0]]['id'];?>]"/>
		<td align="left"><a onclick="ajax('addContent','<?php echo $this->params['controller'] ?>/edit/<?php echo $v[$uses[0]]['id'];?>');" href="javascript:;" > <?php echo $v[$uses[0]]['key'];?></a> </td>
		<?php if($v[$uses[0]]['parent_id']==1){?>
      		<td align="left" colspan=2></td>
      	<?php }else{?>
      	
	        <td align="left"><?php echo $v[$uses[0]]['value'];?></td>
	        <td align="left"><?php echo $v[$uses[0]]['description'];?></td>
			
	        
      	<?php }?>
      	<!-- order -->
        <td align="center">
      		<span title="<?php _resource('up');?>"><a href="javascript:;" onclick="ajax('listContent','<?php echo $this->params['controller']?>/moveUp/<?php echo $v[$uses[0]]['id'];?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/uparrow.png"/></a></span>
			<span title="<?php _resource('down');?>"><a href="javascript:;" onclick="ajax('listContent','<?php echo $this->params['controller']?>/moveDown/<?php echo $v[$uses[0]]['id'];?>');return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/downarrow.png"/></a></span>
		</td>  
        <td align="left"><?php echo $v[$uses[0]]['created'];?></td>
        <td align="left"><?php echo $v[$uses[0]]['modified'];?></td>
        
        <!--published -->
        <?php if($v[$uses[0]]['parent_id']==1){?>
        <td align="center">
            <div id="published_<?php echo $v[$uses[0]]['id']?>" >
              
                  <?php 
					if($v[$uses[0]]['published']){
						echo '
						<span title="'._resource('published',true).'">
				<a href="javascript:;">
						<img src="'.$this->webroot.'img/backend/tick.png'.'" width="16" height="16" border="0" alt="'._resource('published',true).'" onclick="ajax(\'published_'.$v[$uses[0]]['id'].'\',\''.$this->params['controller'].'/published/'.$v[$uses[0]]['id'].'/0\');" /></a></span>';
					}
					else{
						echo '
						<span title="'._resource('unpublished',true).'">
				<a href="javascript:;">
						<img src="'.$this->webroot.'img/backend/publish_x.png'.'" width="16" height="16" border="0" alt="'._resource('unpublished',true).'" onclick="ajax(\'published_'.$v[$uses[0]]['id'].'\',\''.$this->params['controller'].'/published/'.$v[$uses[0]]['id'].'/1\');" /></a></span>';
					}
					?>
                </div>
         </td>
        <?php }else{?>
        	<td align="center"></td>
        <?php }?>
        <td align="center">
			<span title="<?php _resource('edit');?>"><a href="javascript:;" onclick="ajax('addContent','<?php echo $this->params['controller']?>/edit/<?php echo $v[$uses[0]]['id'];?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-edit.png"/></a></span>
			<span title="<?php _resource('delete');?>"><a href="javascript:;" onclick="ajaxSubmit('listContent','<?php echo $this->params['controller']?>/delete/<?php echo $v[$uses[0]]['id'];?>','deleteone','',true);return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-trash.png"/></a></span>
		</td>
      </tr>
      <?php } ?>
      <?php } ?>
      
          </tbody>
      </table>
</form>
<script>
	setTimeout("removeMessage()",8000);	
</script>
<div class="pagination">
                <span><?php _resource('display') ?> #
                  <select name="limit" id="limit" class="inputbox" size="1" onchange="ajax('listContent','<?php echo $this->params['controller']?>/display/'+this.value);">
                    <?php 
							for($i=1;$i<10;$i++){
								$v=$i*$webConfig['default_row_per_page'];
								$select=($this->Session->read($uses[0].'2'.'.limit')==$v)?'selected="selected"':'';
								echo '<option value="'.$v.'" '.$select.' >'.$v.'</option>';
							}
						?>
                  </select>
                </span>
                <!-- Button prev -->
           
                <?php
                	$paging=$this->Paginator->getPages(); 
							if(isset($paging['prev'])){
								echo $paging['prev'];
							}
							
							
						?>
                <!-- end Button prev -->
                
                    <?php
                    	echo $paging['paging'];
					?>
                  
                <!-- Button next -->
                
                <?php 
							if(isset($paging['next'])){
								echo $paging['next'];
							}
							
						?>
                <!-- end Button next -->
                <span>
                  <?php if(!empty($paging['cboPaging'])){
								echo _resource('goto',true).' # '.$paging['cboPaging'];
							}?>
                </span>
                <span>
                  <?php
								if($paging['totalPage']>0){
								?>
                  Page <?php echo $paging['currentPage']?>/<?php echo $paging['totalPage']?> </span>
                <?php
								}
								?>
                
</div>
<?php echo $this->element('sql_dump'); ?>